#include <bits/stdc++.h>
using namespace std;
/*自己的代码9/11，注意条件！还有=-1的情况10/11*/
/*假设p1等于0，算出所有的数，然后将最小的数转换成1，其他数按照比例进行转换*/
const int M = 2e5 + 7;
int n, q[M], p[M], minp=0, d;

int main()
{
	cin >> n;
	for (int i = 1; i <= n - 1; i++)
	{
		p[1] = 0;
		cin >> q[i];
		p[i + 1] = q[i] + p[i];
	}
	int minp = p[1];
	for (int i = 1; i <= n; i++)
	{
		if (p[i] < minp)
		{
			minp = p[i]; // 更新最小值
		}
	}
	for (int i = 1; i <= n; i++)
	{
		d = 1 - minp;
		p[i] += d;
	}
	for (int i = 1; i <= n; i++)
	{
		if (p[i] > n || p[i] < 1)
		{
			cout << -1;
			return 0;
		}
		else if (p[i] == p[i + 1])
		{
			cout << -1;
			return 0;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		cout << p[i] << " ";
	}
	return 0;
}
/*参考题解
#include<bits/stdc++.h>
using namespace std;
const int M=2e5+7;
int n,q[M],p[M],tmp[M],minp=0,d;
bool flag;

int main( )
{
	cin>>n;
	for(int i=1;i<=n-1;i++)
	{
		cin>>q[i];
	}
	for (int i = 2; i <= n; i++) {
		p[i]=p[i-1]+q[i-1];
		if (p[i] < minp) {
			minp = p[i]; // 更新最小值
		}
	}
	for(int i=1;i<=n;i++)
	{
		p[i]=p[i]-minp+1;
		tmp[i]=p[i];
		if(tmp[i]>n||tmp[i]<1)
		{
			cout<<-1;
			return 0;
		}
	}
	sort(tmp+1,tmp+n+1);

	for(int i=1;i<=n-1;i++)
	{
	   if(tmp[i]==tmp[i+1]){
		cout<<-1;
		return 0;
	   }
	}
	for(int i=1;i<=n;i++)
		cout<<p[i]<<" ";
	return 0;
}
*/